const mongoose = require('mongoose')

const Schema = mongoose.Schema

mongoose.connect("mongodb://localhost/graproject", { useNewUrlParser: true })

var blogSchema = new Schema({
    
    userName: {//用户名
        type: String,
        require: true
    },
    authName:{//作者名
        type: String,
        require: true
    },
    paw: {//密码
        type: String,
        require: true
    },
    email: {//邮箱
        type: String,
        require: true
    },
    cssStyle:{//博客样式
        type: String,
        default: ''
    },
    gHtml:{//公告html
        type: String,
        default: ''
    }
})

module.exports = mongoose.model('blog', blogSchema)